<%namespace name="admin" module="django.contrib.admin.templatetags.adminmedia" />

<% 
    from django.contrib.admin.views.main import SEARCH_VAR
%>

% if cl.search_fields:

<div id="toolbar"><form id="changelist-search" action="" method="get">
<div><!-- DIV needed for valid HTML -->
<label for="searchbar"><img src="${admin.admin_media_prefix()}img/admin/icon_searchbox.png" alt="Search" /></label>
<input type="text" size="40" name="${SEARCH_VAR}" value="${cl.query}" id="searchbar" />
<input type="submit" value="${trans('Go')}" />

% if show_result_count:

    <span class="small quiet"><%def name="blocktrans()"><% counter = cl.result_count %>1 result{% plural %}${counter} results</%def>${blocktrans()} (<a href="?
% if cl.is_popup:
pop=1
% endif
"><%def name="blocktrans()"><% full_result_count = cl.full_result_count %>${full_result_count} total</%def>${blocktrans()}</a>)</span>

% endif


% for pair in cl.params.items():

    % if pair[0] != SEARCH_VAR:
        <input type="hidden" name="${pair[0]}" value="${pair[1]}"/>
    % endif

% endfor

</div>
</form></div>
<script type="text/javascript">document.getElementById("searchbar").focus();</script>

% endif

